<?php
include($_SERVER["DOCUMENT_ROOT"] . "/news/model.php");
include($_SERVER["DOCUMENT_ROOT"] . "/news/view.php");
include($_SERVER["DOCUMENT_ROOT"] . "/type/controller.php");

$content_left_column = controller_news_type_on_request();

$type = NULL;
$page = NULL;
$list_per_page = 10;

if (array_key_exists("type", $_GET))
{
	$type = $_GET["type"];
}
if (array_key_exists("page", $_GET))
{
	$page = $_GET["page"];
}
else
{
	$page = 1;
}

$news_list = model_get_news_list($type, $page, $list_per_page);
$page_count = model_get_news_page_count($type, $list_per_page);

$content_center_column = view_news_list($news_list);
$content_center_column = $content_center_column . view_news_page_list($page, $page_count, $type);

$content_right_column = "";

include($_SERVER["DOCUMENT_ROOT"] . "/template/layout.php");
?>
